﻿using UnityEngine;
using System.Collections;

public class MapExamples {

    public static GameObject Modality_01() {
        GameObject obj = new GameObject("Modality_01");
        float sideLen = 4.0f;
        int sideCount = 7;
        for (int i = 0; i < sideCount; i++) {
            for (int j = 0; j < sideCount; j++) {
                if (i == 0 || i == sideCount - 1 || j == 0 || j == sideCount - 1) {
                    SteelUnit su = steelUnit;
                    su.transform.position += (Vector3.forward * i + Vector3.right * j) * sideLen;
                    su.transform.parent = obj.transform;
                }
            }
        }

        obj.transform.position += (Vector3.back + Vector3.left) * sideCount * sideLen / 2;
        return obj;
    }


    protected static SteelUnit steelUnit {
        get {
            GameObject gameObj = Resources.Load("Prefabs/SteelUnit") as GameObject;
            GameObject obj = GameObject.Instantiate(gameObj) as GameObject;
            return obj.GetComponent<SteelUnit>();
        }
    }

}
